<!DOCTYPE html>
<html>

<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
	<title>开票详情 </title>
	<meta http-equiv="expires" content="0">
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<link rel="stylesheet" href="../../../../css/reset.css" />
	<link rel="stylesheet" href="../../../../css/mui.min.css" />
	<link rel="stylesheet" href="../../../../css/iconfont.css?time=321" />
	<link rel="stylesheet" href="../../../../css/cmms.css" />
	<link rel="stylesheet" href="../../../../css/mui.picker.min.css" />
	<link rel="stylesheet" href="../../../../css/doctor/order.css" />
	<link rel="stylesheet" href="../../../../css/sale/ticket/InvoiceDetails/InvoiceDetails.css" />
	<script src="../../../../js/vconsole.min.js"></script>
</head>

<body>
	<div id="invoiceDetails">

		<div class="mui-content ">
			<table></table>
			<div class="mui-row seation">
				<div class="mui-col-sm-12 mui-col-xs-12 ">
					<li>
						<!-- 此处要判断 电子 -->
						发票详情： <span v-if='isduib()'>电子发票</span>
						<span v-else>纸质发票</span>
					</li>
				</div>
				<div class="mui-col-sm-12 mui-col-xs-12 division">
					<li>
						发票抬头： <span>{{this.invoiceTitle}}</span>
					</li>
				</div>
				<div class="mui-col-sm-12 mui-col-xs-12">
					<li>
						发票金额： <span>{{this.invoiceAmount}}元</span>
					</li>
				</div>

				<div class="mui-col-sm-12 mui-col-xs-12 division" >
					<li >
						
					</li>
				</div>
				<!-- 此处要判断 电子 -->
				<div class="mui-col-sm-12 mui-col-xs-12 " v-if='isduib()'>
					<li>
						邮箱： <span>{{this.email}}</span>
					</li>
				</div>
				<!-- 此处要判断 纸质 -->
				<div v-else>
						<div class="mui-col-sm-12 mui-col-xs-12 " >
								<li >
									收件人： <span>{{this.postUser}}</span>
								</li>
							</div>
							<div class="mui-col-sm-12 mui-col-xs-12">
								<li>
									电话： <span>{{this.postPhone}}</span>
								</li>
							</div>
							<div class="mui-col-sm-12 mui-col-xs-12">
								<li class="over">
									详细地址： <span>{{this.postAddress}}</span>
								</li>
							</div>
				</div>	
					
			
				<div class="mui-col-sm-12 mui-col-xs-12 division">
					<li>
						开票状态： <span class="font-c">{{this.state+''| billingStatus}}</span>					
					</li>
				</div>
				<div class="mui-col-sm-12 mui-col-xs-12">
					<li>
						开票编号： <span>{{this.invoiceNo}}</span>

					</li>
				</div>
				<div class="mui-col-sm-12 mui-col-xs-12">
					<li>
						开票时间： <span>{{this.invoiceTime | replaceT }}</span>
					</li>
				</div>
				<!-- 此处要判断 纸质 -->
				<div v-show='!isduib()'>
					<div class="mui-col-sm-12 mui-col-xs-12">
						<li>
							面单号： <span>{{this.expressNo}}</span>
						</li>
					</div>
					<div class="mui-col-sm-12 mui-col-xs-12">
						<li>
							寄件人： <span>{{this.sender}}</span>
						</li>
					</div>
				</div>
				<!-- 图片 -->
				<div class="mui-col-sm-12 mui-col-xs-12 division" >
					<li >
					
						<img style="width:160px; height:160px" :src="imgSrc" @click="imgFileId"
						  alt="">
					</li>
				</div>
				
			</div>
		</div>
		<div class="customer ">
			<span>
				客服热线：400 878 6528
			</span>
		</div>
	</div>




	<script src="../../../../js/mui.min.js"></script>
	<script src="../../../../js/mui.picker.min.js"></script>
	<script src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
	<script src="../../../../js/vue.js"></script>
	<script src="../../../../js/cmms.js?time=222"></script>
	<script>
		new Vue({
			el: "#invoiceDetails",
			data() {
				return {
					orderId: '',
					materialType: '',
					invoiceAmount: '',
					invoiceTitle: '',
					postPhone: '',
					sender: '',
					expressNo: '',
					postAddress: '',
					postUser: '',
					state: '',
					email: '',
					invoiceNo: '',
					invoiceTime: '',
					fileId:'',
					imgSrc:''
				}
			},
			methods: {
				isduib() {
					return this.materialType === 0 ? true : false;
				},
				btn() {
					AT.muiAjax('/partner-sale/inspectionFees/getOrderInvoiceInfo', 'post', {

						"id": this.orderId
						// "id": 819
					}, (res) => {
						console.log(res)
						console.log(1111)
						
						this.invoiceAmount = res.invoiceAmount //发票金额
						this.email = res.email //邮箱		
						this.materialType = res.materialType //发票类型
						this.invoiceTitle = res.invoiceTitle //抬头名字
						this.invoiceTime = res.invoiceTime //时间
						this.invoiceNo = res.invoiceNo //开票编号
						this.postPhone = res.postPhone //电话
						this.sender = res.sender//发件人
						this.expressNo = res.expressNo//快递号
						this.postUser = res.postUser//收件人
						this.postAddress = res.postAddress//地址
						this.state = res.state//开票状态

						this.fileId=res.fileId ///图片预览接口代码
						// this.state=2//开票状态	
						this.imgSrc = "https://api.lis.ulabcare.com/api/common/common/downLoadFile?attachId="+this.fileId+"&type=0";
//						this.imgSrc = "http://pic1.nipic.com/2009-02-17/200921701719614_2.jpg";
//						expressCompanyCode: "ganzhongnengda"
						// expressNo: "131313"//快递号
						// invoiceAmount: 0.01
						// invoiceTitle: "张小"
						// materialType: 1
						// postAddress: "string"
						// invoiceNo: "1313123"//开票编号
						// invoiceTime: "2019-05-14T17:13:50" //时间
						// email: "778271768@qq.com"//邮箱
						// postUser: "string"//收件人
						// sender: "123123123"//发件人
//						state: 0
//						type: 0
						
					});
					
				},
				getUrl() {
					let _this = this;
					var url = location.search; //获取url中"?"符后的字串    
					var theRequest = new Object();

					if (url.indexOf("?") != -1) {
						var str = url.substr(1);
						//					      console.log(str);
						strs = str.split("&");
						for (var i = 0; i < strs.length; i++) {
							theRequest[strs[i].split("=")[0]] = unescape(strs[i].split("=")[1]);
						}
					}
					_this.orderId = theRequest.orderId;
					// _this.userId = theRequest.userId;				   
				},
				imgFileId(){
					console.log("id:"+this.imgSrc)
					


							wx.previewImage({
								current: this.imgSrc, // 当前显示图片的http链接
								urls: [this.imgSrc] // 需要预览的图片http链接列表
								});
						// });
				},
			},
			created() {
				this.getUrl(),
				this.btn()
				
			},
			mounted	(){
			AT.muiAjax('/partner-sale/partnerSale/wxConfig','post',{url:location.href.split('#')[0]},
				function(res){
					wx.config({
//						debug:true,
					appId:res.appId,
					timestamp:res.timestamp,
					nonceStr:res.nonceStr,
					signature:res.signature,
					jsApiList:['previewImage']
				});
			})
		}
	})

	</script>
</body>

</html>